/*
 * $Id: StepLogsDAO.java,v 1.8 2009/12/16 19:57:53 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.database.dao;

import java.util.ArrayList;
import java.util.List;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.database.pojo.HstStepLogs;
import com.ge.healthcare.autosc.common.database.pojo.HstStepTime;

/**
 * @author 212042764
 * 
 */
public class StepLogsDAO extends BaseDAO implements IStepLogsDAO {
	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = 7223153311039375470L;

	private static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.HstStepLogs";

	private static final String COL_STEP_LOG_ID = "stepLogId";
	private static final String COL_STEP_TIME_ID = "hstStepTime";

	public StepLogsDAO() {
		super(TABLE_NAME);
	}

	public HstStepLogs getStepLogByID(Long stepLogID) {
		Object stepLogs = findObjectByID(COL_STEP_LOG_ID, stepLogID);
		if (!ASCUtil.isNullOrEmptyObject(stepLogs)) {
			return (HstStepLogs) stepLogs;
		}
		return null;
	}

	public List<HstStepLogs> getStepLogsByStepTimeId(HstStepTime stepTimeId) {
		List<?> rtvdLogs = findByProperty(COL_STEP_TIME_ID, stepTimeId, COL_STEP_LOG_ID);
		if (!ASCUtil.isNullOrEmptyList(rtvdLogs)) {
			List<HstStepLogs> stepLogs = new ArrayList<HstStepLogs>();
			for (int iCount = 0; iCount < rtvdLogs.size(); iCount++) {
				stepLogs.add((HstStepLogs) rtvdLogs.get(iCount));
			}
			return stepLogs;
		}
		return null;
	}

	public void save(Object pojo) {
		super.save(pojo);
	}

	public void saveAlways(Object pojo) {
		super.save(pojo);
	}

	public void deleteByID(Object pojo) {
		super.deleteByID(pojo);
	}

	public void refresh(Object pojo) {
		super.refresh(pojo);
	}
}
